package strategy.improve;

/**
 * @Author liangliangzhao
 * @data 2023/4/21 11:35
 */

public class Client {
    public static void main(String[] args) {
        WildDuck wildDuck = new WildDuck("鸭鸭子");
        wildDuck.fly();

        ToyDuck toyDuck = new ToyDuck("工具鸭");
        toyDuck.fly();

        PekingDuck duck = new PekingDuck("北京鸭");
        duck.fly();
        //动态的改变某个对象的行为 北京鸭不能飞
        duck.setFlyBehavior(new NoFlyBehavior());
        duck.fly();

    }
}
